package com.example.trb.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @Length(max = 32, message = "名字太长了")
    @NotBlank(message = "名字不能为空")
    private String name;

    @Length(min = 6, max = 6)
    @NotBlank(message = "账户不能为空")
    private String account;

    @Length(min = 6, max = 12)
    @NotBlank(message = "密码不能为空")
    private String password;

    public User() {
    }

    public User(String account, String password) {
        this.account = account;
        this.password = password;
    }
}
